<%-- 
    Document   : showEvent
    Created on : 5-mag-2014, 22.18.25
    Author     : Fede programmer
--%>

<%@page import="entity.Evento"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <title>SportingEventClub - Evento</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="CSS/BaseSite.css" />
        <link rel="stylesheet" type="text/css" href="CSS/coin-slider-styles.css"/>
        <link rel="stylesheet" type="text/css" href="CSS/vertical-ticker.css"/>        
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>        
        <script type="text/javascript" src="JQuery/coin-slider.js"></script>     
        <script type="text/javascript" src="JQuery/jquery.pajinate.js"></script>
        <script type="text/javascript" src="JQuery/jquery.totemticker.js"></script>
        <link rel="shortcut icon" href= "Images/stadion-icon.png"/>
        <title>ShowEvent</title>        
        <script type="text/javascript">
	$(document).ready(function() {
		$('#coin-slider').coinslider({ width: 745, navigation: true, delay: 5000 });
	});
	</script>
        <script type="text/javascript">
        $(function(){
          $(".text").each(function(i){
            len=$(this).text().length;
            if(len>150)
            {
              $(this).text($(this).text().substr(0,150)+'...');
            }
          });
        });
        </script>
        <script type="text/javascript">
            $(document).ready(function(){
                $('#paging_container2').pajinate({
                    nav_label_first : '<<',
                    nav_label_last : '>>',
                    nav_label_prev : '<',
                    nav_label_next : '>'
                });
            });				
        </script>        
        <script type="text/javascript">
            $(document).ready(function(){
                $('li:odd, .paging > *:odd');
            });
	</script>
    </head>
    <body>
        <div class="main">
            <div class="page">
                <div class="header">
                    <div class="login">
                        <%@include file="login.jsp"%>
                    </div>
                    <div class="banner">                       
                    </div>
                    <div class="topmenu">
                        <%@include file="topmenu.jsp" %>
                    </div>
                </div>
                    <div class="content">
                        <div class="content-in">
                            <div class="left-panel">
                                <div class="left-panel-in">
                                    <%List<Evento> listEvents = (List)request.getAttribute("listaeventi");%>
                                    <div class="eventSlider">
                                        <div id="coin-slider">
                                            <%if(listEvents.size() == 0){%>
                                            no eventi
                                            <%}else{%>
                                            <%for(int i=0; i< 5; ++i){%>
                                            <a href="/mfm-centro-sportivo-war/GeneralController?submit=visualizzaSingoloEvento&idevento=<%=listEvents.get(i).getId()%>" >
                                                <%String locandina = listEvents.get(i).getLocandina().replace(".jpg", "2.jpg");%>
                                                <img src="<%=locandina%>" />
                                            <span>
                                            <%=listEvents.get(i).getTitoloEvento()%>
                                            </span>
                                            </a>
                                            <%}%>
                                            <%}%>
                                        </div>
                                    </div>
                                        <%if(listEvents.size() != 0){%>
                                        <div id="paging_container2">
                                            <ul class="paging">
                                                <%for(int i = 0; i < listEvents.size(); ++i){%>
                                                <%String[] data = listEvents.get(i).getDataEvento().toString().split("-");%>
                                                <form action="GeneralController" method="post">
                                                    <input type="hidden" name="idevento" value="<%=listEvents.get(i).getId()%>"/>
                                                    <li><table border="0" class="tabEvent">
                                                            <tr>
                                                                <th width="160" height="120" rowspan="3" scope="col">
                                                                    <a href="/mfm-centro-sportivo-war/GeneralController?submit=visualizzaSingoloEvento&idevento=<%=listEvents.get(i).getId()%>" >
                                                                        <img class="imageborder" src="<%=listEvents.get(i).getLocandina()%>" width="160" height="120"/>
                                                                    </a>
                                                                </th>
                                                                <th align="left" valign="top" scope="col" style="text-transform: uppercase; color: #E42918; font: bold 13px Arial, Verdana, sans-serif; ">
                                                                    <%=listEvents.get(i).getTitoloEvento()%>
                                                                </th>
                                                            </tr>
                                                            <tr>
                                                                <th align="left" valign="top" scope="col"><%=data[2] + "-" + data[1] + "-" + data[0]%></th>
                                                            </tr>
                                                            <tr>
                                                                <th class="text" align="left" valign="top" scope="col"><%=listEvents.get(i).getDescrizioneEvento()%></th>
                                                            </tr>
                                                            <tr>
                                                                <td height="23">&nbsp;</td>
                                                                <td align="right">
                                                                    <button type="submit" class="myButton blue" id="btnsubmit" name="submit" value="prenotaSingoloEvento">
                                                                        ACQUISTA
                                                                    </button>
                                                                </td>
                                                            </tr>
                                                    </table></li>
                                                </form>
                                                <%}%>
                                            </ul>
                                            <p style="align:center;"><div class="page_navigation"></div></p>
                                        </div>
                                        <%}%>
                                </div>
                            </div>
                                <div class="right-panel">
                                    <div class="right-panel-in">
                                        <jsp:include page="/GeneralController">
                                        <jsp:param name="submit" value="right-content"/>
                                        <jsp:param name="op" value="newsbox"/>
                                        </jsp:include>
                                    </div> 
                                </div>
                        </div>
                    </div>
                                <div class=\"footer\">
                                    <%@include file="footer.jsp" %>
                                </div>
            </div>
        </div>
    </body>
</html>
